import { FC } from 'react'
import { Menu, Layout, theme } from 'antd';
import type { MenuProps } from 'antd';
import { LaptopOutlined, NotificationOutlined, UserOutlined } from '@ant-design/icons';
import { useNavigate } from 'react-router-dom';
const { Sider } = Layout;

const items2: MenuProps['items'] = [
    {
        key: '/',
        icon: <UserOutlined />,
        label: '访客管理',

        children: [
            {
                key: '/visitror/list',
                label: '访客列表'
            },
            {
                key: '/visitror/desc',
                label: '访客详情'

            }
        ]
    }]

interface IMatchesProps {
    updateMathes: (arr:any[]) => void
}
const SliderMenu: FC<IMatchesProps> = ({ updateMathes }) => {
    const navigate = useNavigate()
    return (<Sider width={200}>
        <Menu
            mode="inline"
            defaultSelectedKeys={['/']}
            defaultOpenKeys={['/']}
            style={{ height: '100%', borderRight: 0 }}
            items={items2}
            onSelect={async (path) => {
               await navigate(path.selectedKeys[0])
               await updateMathes(JSON.parse(window.sessionStorage.getItem('matches') as any))
            }}
        />
    </Sider>);
}
export default SliderMenu;
